import {RequestUtil} from '@/utils'

export class ProductHttp {
    static PREFIX = "/manager/product"
    // 场地管理

    static getPlacePageList =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/basic/place/pageList` ,params)

    static addPlace = (data: Record<string, any>) => RequestUtil.postAjax(`${this.PREFIX}/basic/place/add`, data)

    static updatePlace = (id: string | number, data: Record<string, any>) => RequestUtil.putAjax(`${this.PREFIX}/basic/place/update/${id}`, data)

    static delPlace = (data: any[]) => RequestUtil.delAjax(`${this.PREFIX}/basic/place/delete`, data)

    // 猪圈管理

    static getPigstyPageList =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/basic/pigsty/pageList` ,params)

    static addPigsty = (data: Record<string, any>) => RequestUtil.postAjax(`${this.PREFIX}/basic/pigsty/add`, data)

    static updatePigsty = (id: string | number, data: Record<string, any>) => RequestUtil.putAjax(`${this.PREFIX}/basic/pigsty/update/${id}`, data)


    static initialize = (id: string ) => RequestUtil.putAjax(`${this.PREFIX}/basic/pigsty/initialize/${id}`)

    static delPigsty = (data: any[]) => RequestUtil.delAjax(`${this.PREFIX}/basic/pigsty/delete`, data)

    // 耳标管理
    static getRfidPageList =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/basic/rfid/pageList` ,params)

    static addRfid = (data: Record<string, any>) => RequestUtil.postAjax(`${this.PREFIX}/basic/rfid/add`, data)

    static updateRfid = (id: string | number, data: Record<string, any>) => RequestUtil.putAjax(`${this.PREFIX}/basic/rfid/update/${id}`, data)

    static delRfid = (data: any[]) => RequestUtil.delAjax(`${this.PREFIX}/basic/rfid/delete`, data)


    // 摄像头

    static getCameraDetailList =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/basic/cameraDetail/pageList` ,params)


    static refreshCamera =  () => RequestUtil.getAjax(`${this.PREFIX}/basic/camera/refreshCamera`)

    static refreshDetailCamera =  () => RequestUtil.getAjax(`${this.PREFIX}/basic/cameraDetail/refreshCamera`)

    static updateCameraDetail = (id: string | number, data: Record<string, any>) => RequestUtil.putAjax(`${this.PREFIX}/basic/cameraDetail/update/${id}`, data)


    static getCameraList =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/basic/camera/pageList` ,params)

    static addCamera = (data: Record<string, any>) => RequestUtil.postAjax(`${this.PREFIX}/basic/camera/add`, data)

    static updateCamera = (id: string | number, data: Record<string, any>) => RequestUtil.putAjax(`${this.PREFIX}/basic/camera/update/${id}`, data)

    static delCamera = (data: any[]) => RequestUtil.delAjax(`${this.PREFIX}/basic/camera/delete`, data)

    // 获取直播地址
    static getCameraAddress =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/basic/camera/getAddress` ,params)

    static getCameraDetailAddress =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/basic/cameraDetail/getAddress` ,params)

    // 猪仔品种

    static getBreedList =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/pig/breed/pageList` ,params)

    static addBreed = (data: Record<string, any>) => RequestUtil.postAjax(`${this.PREFIX}/pig/breed/add`, data)

    static updateBreed = (id: string | number, data: Record<string, any>) => RequestUtil.putAjax(`${this.PREFIX}/pig/breed/update/${id}`, data)

    static delBreed = (data: any[]) => RequestUtil.delAjax(`${this.PREFIX}/pig/breed/delete`, data)

    // 猪仔等级

    static getLevelList =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/pig/level/pageList` ,params)

    static addLevel = (data: Record<string, any>) => RequestUtil.postAjax(`${this.PREFIX}/pig/level/add`, data)

    static updateLevel = (id: string | number, data: Record<string, any>) => RequestUtil.putAjax(`${this.PREFIX}/pig/level/update/${id}`, data)

    static delLevel = (data: any[]) => RequestUtil.delAjax(`${this.PREFIX}/pig/level/delete`, data)

    // 食物

    static getProfileList =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/props/profile/pageList` ,params)

    static addProfile = (data: Record<string, any>) => RequestUtil.postAjax(`${this.PREFIX}/props/profile/add`, data)

    static updateProfile = (id: string | number, data: Record<string, any>) => RequestUtil.putAjax(`${this.PREFIX}/props/profile/update/${id}`, data)

    static delProfile = (data: any[]) => RequestUtil.delAjax(`${this.PREFIX}/props/profile/delete`, data)

    // 套餐

    static getComboList =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/props/combo/pageList` ,params)

    static addCombo = (data: Record<string, any>) => RequestUtil.postAjax(`${this.PREFIX}/props/combo/add`, data)

    static updateCombo = (id: string | number, data: Record<string, any>) => RequestUtil.putAjax(`${this.PREFIX}/props/combo/update/${id}`, data)

    static delCombo = (data: any[]) => RequestUtil.delAjax(`${this.PREFIX}/props/combo/delete`, data)
    // 服务

    static getServeList =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/props/serve/pageList` ,params)

    static addServe = (data: Record<string, any>) => RequestUtil.postAjax(`${this.PREFIX}/props/serve/add`, data)

    static updateServe = (id: string | number, data: Record<string, any>) => RequestUtil.putAjax(`${this.PREFIX}/props/serve/update/${id}`, data)

    static delServe = (data: any[]) => RequestUtil.delAjax(`${this.PREFIX}/props/serve/delete`, data)

    // 零食
    static getSnacksList =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/props/snacks/pageList` ,params)

    static addSnacks = (data: Record<string, any>) => RequestUtil.postAjax(`${this.PREFIX}/props/snacks/add`, data)

    static updateSnacks = (id: string | number, data: Record<string, any>) => RequestUtil.putAjax(`${this.PREFIX}/props/snacks/update/${id}`, data)

    static delSnacks = (data: any[]) => RequestUtil.delAjax(`${this.PREFIX}/props/snacks/delete`, data)
    // 销售管理

    static getGoodsList =  (params: Record<string, any>) => RequestUtil.getAjax(`${this.PREFIX}/pig/goods/pageList` ,params)

    static addGoods = (data: Record<string, any>) => RequestUtil.postAjax(`${this.PREFIX}/pig/goods/add`, data)

    static updateGoods = (id: string | number, data: Record<string, any>) => RequestUtil.putAjax(`${this.PREFIX}/pig/goods/update/${id}`, data)

    static delGoods = (data: any[]) => RequestUtil.delAjax(`${this.PREFIX}/pig/goods/delete`, data)


}
